import java.util.*;

/**
 * @author zyj
 * @date 2022年05月20日 16:32
 */
public class 省市联动 {
    public static void main(String[] args) {
        Map<String, Map<String,Map<String, List<String>>>> country = new HashMap<>();
        Map<String,Map<String, List<String>>> shen = new HashMap<>();
        Map<String, List<String>> shanXi = new HashMap<>();
        List<String> xiAn = new ArrayList<>();
        xiAn.add("雁塔区");
        xiAn.add("未央区");
        xiAn.add("碑林区");
        xiAn.add("曲江新区");
        shanXi.put("西安市",xiAn);
        List<String> xianYang = new ArrayList<>();
        xianYang.add("渭城区");
        xianYang.add("秦都区");
        shanXi.put("咸阳市",xianYang);
        shen.put("陕西省",shanXi);
        Map<String, List<String>> huBei = new HashMap<>();
        List<String> wuHan = new ArrayList<>();
        wuHan.add("武昌区");
        wuHan.add("汉口区");
        wuHan.add("江夏区");
        wuHan.add("青山区");
        huBei.put("武汉市",wuHan);
        List<String> enShi = new ArrayList<>();
        enShi.add("巴东县");
        enShi.add("五峰县");
        huBei.put("恩施市",enShi);
        shen.put("湖北省",huBei);
        country.put("中国",shen);

//        Set<Map.Entry<String, Map<String,Map<String, List<String>>>>> countryEntrySet =  country.entrySet();
//       Iterator<Map.Entry<String, Map<String,Map<String, List<String>>>>> countryIterator = countryEntrySet.iterator();
//       while (countryIterator.hasNext()){
//           Map.Entry<String, Map<String,Map<String, List<String>>>> countryEntry = countryIterator.next();
//
//           System.out.println("国家：" + countryEntry.getKey());
//           Map<String,Map<String, List<String>>> shenMap = countryEntry.getValue();
//
//           Set<Map.Entry<String,Map<String, List<String>>>> shenSet = shenMap.entrySet();
//           Iterator<Map.Entry<String,Map<String, List<String>>>> shenIterator = shenSet.iterator();
//           while (shenIterator.hasNext()){
//               Map.Entry<String,Map<String, List<String>>> shenEntry = shenIterator.next();
//               System.out.println("\t省：" + shenEntry.getKey());
//               Map<String, List<String>> shiMap = shenEntry.getValue();
//               Set<Map.Entry<String, List<String>>> shiSet = shiMap.entrySet();
//               Iterator<Map.Entry<String, List<String>>> shiIterator = shiSet.iterator();
//               while (shiIterator.hasNext()){
//                   Map.Entry<String, List<String>> shiEntry = shiIterator.next();
//                   System.out.println("\t\t" + shiEntry.getKey());
//                   List<String> shi = shiEntry.getValue();
//                   for (String name:shi) {
//                       System.out.println("\t\t\t" + name);
//                   }
//               }
//           }
//       }



       country.forEach((k,v)->{
           System.out.println("国家：" + k);
           v.forEach((a,b)->{
               System.out.println("\t省：" + a);
               b.forEach((c,d)->{
                   System.out.println("\t\t" + c);
                   d.forEach((e) ->{
                       System.out.println("\t\t\t" + e);
                   });
               });
           });
       });


       country.keySet();

    }
}
